package com.sugon.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.sugon.dao.ToolsTechEquDao;
import com.sugon.entity.ToolsTechEquEntity;
import com.sugon.service.ToolsTechEquService;
import com.sugon.utils.Constant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 工装技术档案关联表Service实现类
 *
 * @author sugon
 * @date 2019-08-05 09:24:58
 */
@Service("toolsTechEquService")
public class ToolsTechEquServiceImpl implements ToolsTechEquService {
    @Autowired
    private ToolsTechEquDao toolsTechEquDao;

    @Override
    public ToolsTechEquEntity queryObject(String id) {
        return toolsTechEquDao.queryObject(id);
    }

    @Override
    public List<ToolsTechEquEntity> queryList(Map<String, Object> map) {
        return toolsTechEquDao.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return toolsTechEquDao.queryTotal(map);
    }

    @Override
    public int save(ToolsTechEquEntity toolsTechEqu) {
        toolsTechEqu.setId(RandomUtil.randomString(32));
        toolsTechEqu.setDelFlag(Constant.IS_NOT_DEL_INT);
        return toolsTechEquDao.save(toolsTechEqu);
    }

    @Override
    public int update(ToolsTechEquEntity toolsTechEqu) {
        return toolsTechEquDao.update(toolsTechEqu);
    }

    @Override
    public int delete(String id) {
        return toolsTechEquDao.delete(id);
    }

    @Override
    public int deleteBatch(String[] ids) {
        return toolsTechEquDao.deleteBatch(ids);
    }
}
